package com.link.base.base.wechat.service;

import com.link.base.base.accnt.model.Account;
import com.link.base.base.wechat.model.WxInnerBatch;
import com.link.base.base.wechat.model.WxSendBatch;
import com.link.core.basic.service.BasicService;

import java.util.List;
import java.util.Map;

/**
 * WxSendBatch-微信素材发送批次 
 *
 * @author 路江
 * @date 2019/05/22 10:48
 */
public interface WxSendBatchService extends BasicService<WxSendBatch> {
    /**
     * 微信素材发送前准备
     *
     * @author lujiang
     * @date 2019-05-22
     * @param wxSendBatch 发送对象
     * @return
     * @throws Exception
     */
    Map<String,Object> sendArticle(WxSendBatch wxSendBatch) throws Exception;

    /**
     * 微信素材发送
     *
     * @author lujiang
     * @date 2019-05-23
     * @param wxInnerBatch 发送批次对象
     * @return
     * @throws Exception
     */
    int sendAllFollowers(WxInnerBatch wxInnerBatch) throws Exception;

    /**
     * 生成消息记录
     *
     * @author lujiang
     * @date 2019-05-23
     * @param wxSendBatch 发送批次对象
     * @return
     */
    int insertMsgRecord(WxSendBatch wxSendBatch, WxInnerBatch wxInnerBatch) throws Exception;

    /**
     * 生成消息记录
     *
     * @author lujiang
     * @date 2019-05-23
     * @param list 消费者集合
     * @accts accts 人群-消费者集合
     * @param wxSendBatch 批次信息
     * @throws Exception
     */
    void insetMsgRecord(List<Account> list, WxSendBatch wxSendBatch, WxInnerBatch wxInnerBatch) throws Exception;

    /**
     * 指定粉丝发送
     *
     * @author lujiang
     * @date 2019-05-23
     * @param wxInnerBatch 发送批次对象
     * @return
     * @throws Exception
     */
    int sendselectedFollowers(WxInnerBatch wxInnerBatch) throws Exception;

    /**
     * 获取多个公众号对应批次
     *
     * @author lujiang
     * @date 2019-05-24
     * @param wxSendBatch 发送批次对象
     * @return
     * @throws Exception
     */
    List<WxInnerBatch> getBatchList(WxSendBatch wxSendBatch) throws Exception;

    /**
     * 从人群包里查询多个公众号获得批次
     *
     * @author lujiang
     * @date 2019-05-24
     * @param wsb 发送批次对象
     * @return
     * @throws Exception
     */
    List<WxInnerBatch> queryBatchList(WxSendBatch wsb) throws Exception;

    /**
     * 定时群发图文接口
     *
     * @author lujiang
     * @date 2019-05-27
     * @throws Exception
     */
    void fixedTimeSendArticle() throws Exception;
}
